<?php
/**
 * Created by PhpStorm.
 * User: 1
 * Date: 2016-12-02
 * Time: 10:27
 */
namespace  app\src\user\enum;

class RoleEnum{
    //后台登录角色-统一
    const ROLE_Admin  = "role_admin";

    //前台用户角色
    const ROLE_User = "role_user"; //普通用户

    const ROLE_Seller = "role_seller"; //商家

    const ROLE_Waiter = "role_waiter"; //店小二

    public static function getRoleIDBy($role_code){
        switch ($role_code){
            case RoleEnum::ROLE_User:
                return 1;
                break;
            case RoleEnum::ROLE_Seller:
                return 2;
                break;
            case RoleEnum::ROLE_Waiter:
                return 3;
                break;
            default:
                return -1;
                break;
        }
        
    }

}